<div class="search_bar">
<input type="text" class="text" onkeyup="ajax_search(this);" value="" />
<div id="ajax_search_result" class="box"></div>
</div>
<script type="text/javascript">
function ajax_search(target) {
    var asr = z.s('ajax_search_result');
    var q = z.trim(target.value);
    if (q == '') {
        asr.style.display = 'none';
        return;
    };
    asr.innerHTML = '<div class="item"><img src="' + z.cdn_url('img/icon/loading3.gif') + '" alt="loading"/></div>';
    var url = z.site_url('?m=node&a=search&method=ajax&q=' + q);
    z.net.get(url,null, function (xhr) {
        //var asr = z.s('ajax_search_result');
        var html = xhr.responseText;
        if (html == '') {
            asr.style.display = 'none';
        } else {
            asr.innerHTML = z.highlight(xhr.responseText, q,'<font style="font-weight:bold; color:#000000">', '</font>');//xhr.responseText.replace(q, '<b>' + q + '</b>');
            asr.style.display = 'block';
        }
    });
}
</script>

